import 'package:json_annotation/json_annotation.dart';

part 'video_info.g.dart';


@JsonSerializable()
class VideoInfo extends Object {

  @JsonKey(name: 'item_id')
  String itemId;

  @JsonKey(name: 'publish_time')
  String publishTime;

  @JsonKey(name: 'raw_publish_time')
  String rawPublishTime;

  @JsonKey(name: 'topics')
  List<Topics> topics;

  @JsonKey(name: 'category')
  Category? category;

  @JsonKey(name: 'labels')
  List<dynamic> labels;

  @JsonKey(name: 'subtitles')
  List<dynamic> subtitles;

  @JsonKey(name: 'type')
  String type;

  @JsonKey(name: 'text')
  String text;

  @JsonKey(name: 'text_pgc')
  String? textPgc;

  @JsonKey(name: 'images')
  List<dynamic> images;

  @JsonKey(name: 'video')
  Video video;

  @JsonKey(name: 'recommend_level')
  String recommendLevel;

  @JsonKey(name: 'author')
  Author author;

  @JsonKey(name: 'consumption')
  Consumption consumption;

  @JsonKey(name: 'liked')
  bool liked;

  @JsonKey(name: 'collected')
  bool collected;

  @JsonKey(name: 'resource_id')
  String resourceId;

  @JsonKey(name: 'resource_type')
  String resourceType;

  @JsonKey(name: 'private_msg_link')
  String privateMsgLink;

  @JsonKey(name: 'comment_extra_tracking_fields')
  Comment_extra_tracking_fields commentExtraTrackingFields;

  @JsonKey(name: 'is_mine')
  bool isMine;

  @JsonKey(name: 'link')
  String link;

  @JsonKey(name: 'app_link')
  String appLink;

  @JsonKey(name: 'real_location')
  String realLocation;

  VideoInfo(this.itemId,this.publishTime,this.rawPublishTime,this.topics,this.category,this.labels,this.subtitles,this.type,this.text,this.textPgc,this.images,this.video,this.recommendLevel,this.author,this.consumption,this.liked,this.collected,this.resourceId,this.resourceType,this.privateMsgLink,this.commentExtraTrackingFields,this.isMine,this.link,this.appLink,this.realLocation);

  factory VideoInfo.fromJson(Map<String, dynamic> srcJson) => _$VideoInfoFromJson(srcJson);

  Map<String, dynamic> toJson() => _$VideoInfoToJson(this);

}


@JsonSerializable()
class Topics extends Object {

  @JsonKey(name: 'id')
  int id;

  @JsonKey(name: 'title')
  String title;

  @JsonKey(name: 'link')
  String link;

  Topics(this.id,this.title,this.link,);

  factory Topics.fromJson(Map<String, dynamic> srcJson) => _$TopicsFromJson(srcJson);

  Map<String, dynamic> toJson() => _$TopicsToJson(this);

}


@JsonSerializable()
class Category extends Object {

  @JsonKey(name: 'id')
  int id;

  @JsonKey(name: 'name')
  String name;

  Category(this.id,this.name,);

  factory Category.fromJson(Map<String, dynamic> srcJson) => _$CategoryFromJson(srcJson);

  Map<String, dynamic> toJson() => _$CategoryToJson(this);

}


@JsonSerializable()
class Video extends Object {

  @JsonKey(name: 'video_id')
  String videoId;

  @JsonKey(name: 'title')
  String title;

  @JsonKey(name: 'title_pgc')
  String? titlePgc;

  @JsonKey(name: 'description_editor')
  String descriptionEditor;

  @JsonKey(name: 'duration')
  VideoDuration duration;

  @JsonKey(name: 'play_ctrl')
  Play_ctrl playCtrl;

  @JsonKey(name: 'play_url')
  String playUrl;

  @JsonKey(name: 'recommend_level')
  String recommendLevel;

  @JsonKey(name: 'tags')
  List<Tags> tags;

  @JsonKey(name: 'cover')
  Cover cover;

  @JsonKey(name: 'background')
  Background background;

  @JsonKey(name: 'width')
  int width;

  @JsonKey(name: 'height')
  int height;

  Video(this.videoId,this.title,this.titlePgc,this.descriptionEditor,this.duration,this.playCtrl,this.playUrl,this.recommendLevel,this.tags,this.cover,this.background,this.width,this.height,);

  factory Video.fromJson(Map<String, dynamic> srcJson) => _$VideoFromJson(srcJson);

  Map<String, dynamic> toJson() => _$VideoToJson(this);

}


@JsonSerializable()
class VideoDuration extends Object {

  @JsonKey(name: 'value')
  int value;

  @JsonKey(name: 'text')
  String text;

  VideoDuration(this.value,this.text,);

  factory VideoDuration.fromJson(Map<String, dynamic> srcJson) => _$VideoDurationFromJson(srcJson);

  Map<String, dynamic> toJson() => _$VideoDurationToJson(this);

}

@JsonSerializable()
class Play_ctrl extends Object {

  @JsonKey(name: 'autoplay')
  bool autoplay;

  @JsonKey(name: 'autoplay_times')
  int autoplayTimes;

  @JsonKey(name: 'need_wifi')
  bool needWifi;

  @JsonKey(name: 'need_cellular')
  bool needCellular;

  Play_ctrl(this.autoplay,this.autoplayTimes,this.needWifi,this.needCellular,);

  factory Play_ctrl.fromJson(Map<String, dynamic> srcJson) => _$Play_ctrlFromJson(srcJson);

  Map<String, dynamic> toJson() => _$Play_ctrlToJson(this);

}

@JsonSerializable()
class Url_list extends Object {

  @JsonKey(name: 'name')
  String name;

  @JsonKey(name: 'url')
  String url;

  @JsonKey(name: 'size')
  int size;

  Url_list(this.name,this.url,this.size,);

  factory Url_list.fromJson(Map<String, dynamic> srcJson) => _$Url_listFromJson(srcJson);

  Map<String, dynamic> toJson() => _$Url_listToJson(this);

}


@JsonSerializable()
class Tags extends Object {

  @JsonKey(name: 'id')
  int id;

  @JsonKey(name: 'title')
  String title;

  @JsonKey(name: 'link')
  String link;

  Tags(this.id,this.title,this.link,);

  factory Tags.fromJson(Map<String, dynamic> srcJson) => _$TagsFromJson(srcJson);

  Map<String, dynamic> toJson() => _$TagsToJson(this);

}


@JsonSerializable()
class Cover extends Object {

  @JsonKey(name: 'url')
  String url;

  @JsonKey(name: 'img_info')
  Img_info imgInfo;

  Cover(this.url,this.imgInfo,);

  factory Cover.fromJson(Map<String, dynamic> srcJson) => _$CoverFromJson(srcJson);

  Map<String, dynamic> toJson() => _$CoverToJson(this);

}


@JsonSerializable()
class Img_info extends Object {

  @JsonKey(name: 'width')
  int width;

  @JsonKey(name: 'height')
  int height;

  @JsonKey(name: 'scale')
  int scale;

  Img_info(this.width,this.height,this.scale,);

  factory Img_info.fromJson(Map<String, dynamic> srcJson) => _$Img_infoFromJson(srcJson);

  Map<String, dynamic> toJson() => _$Img_infoToJson(this);

}


@JsonSerializable()
class Background extends Object {

  @JsonKey(name: 'url')
  String url;

  @JsonKey(name: 'img_info')
  Img_info imgInfo;

  Background(this.url,this.imgInfo,);

  factory Background.fromJson(Map<String, dynamic> srcJson) => _$BackgroundFromJson(srcJson);

  Map<String, dynamic> toJson() => _$BackgroundToJson(this);

}


@JsonSerializable()
class Author extends Object {

  @JsonKey(name: 'uid')
  int uid;

  @JsonKey(name: 'nick')
  String nick;

  @JsonKey(name: 'description')
  String description;

  @JsonKey(name: 'avatar')
  Avatar avatar;

  @JsonKey(name: 'link')
  String link;

  @JsonKey(name: 'type')
  String type;

  @JsonKey(name: 'followed')
  bool followed;

  Author(this.uid,this.nick,this.description,this.avatar,this.link,this.type,this.followed,);

  factory Author.fromJson(Map<String, dynamic> srcJson) => _$AuthorFromJson(srcJson);

  Map<String, dynamic> toJson() => _$AuthorToJson(this);

}


@JsonSerializable()
class Avatar extends Object {

  @JsonKey(name: 'url')
  String url;

  @JsonKey(name: 'shape')
  String shape;

  Avatar(this.url,this.shape,);

  factory Avatar.fromJson(Map<String, dynamic> srcJson) => _$AvatarFromJson(srcJson);

  Map<String, dynamic> toJson() => _$AvatarToJson(this);

}


@JsonSerializable()
class Consumption extends Object {

  @JsonKey(name: 'like_count')
  int likeCount;

  @JsonKey(name: 'collection_count')
  int collectionCount;

  @JsonKey(name: 'comment_count')
  int commentCount;

  @JsonKey(name: 'share_count')
  int shareCount;

  Consumption(this.likeCount,this.collectionCount,this.commentCount,this.shareCount,);

  factory Consumption.fromJson(Map<String, dynamic> srcJson) => _$ConsumptionFromJson(srcJson);

  Map<String, dynamic> toJson() => _$ConsumptionToJson(this);

}


@JsonSerializable()
class Comment_extra_tracking_fields extends Object {

  @JsonKey(name: 'resource_id')
  String resourceId;

  @JsonKey(name: 'resource_type')
  String resourceType;

  Comment_extra_tracking_fields(this.resourceId,this.resourceType,);

  factory Comment_extra_tracking_fields.fromJson(Map<String, dynamic> srcJson) => _$Comment_extra_tracking_fieldsFromJson(srcJson);

  Map<String, dynamic> toJson() => _$Comment_extra_tracking_fieldsToJson(this);

}


